package com.dong.ioc;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * description
 *
 * @author Administrator 2021/08/27 15:04
 */
public class CircularDenpTest {

    public static void main(String[] args) {
        // 构造器注入
        //ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/circularDependence/ConstructorInject.xml");
        // set方法singleton
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/circularDependence/SetterInject-sigleton.xml");
        // set方法prototype
        //ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/circularDependence/SetterInject-prototype.xml");
        System.out.println("环境初始化");
        A a = applicationContext.getBean(A.class);
    }

}
